<html>
<head>
<script type="text/javascript">
function altRows(id){
	if(document.getElementsByTagName){  
		
		var table = document.getElementById(id);  
		var rows = table.getElementsByTagName("tr"); 
		 
		for(i = 0; i < rows.length; i++){          
			if(i % 2 == 0){
				rows[i].className = "evenrowcolor";
			}else{
				rows[i].className = "oddrowcolor";
			}      
		}
	}
}
window.onload=function(){
	altRows('alternatecolor');
}
</script>
<link href="table.css" rel="stylesheet" type="text/css" />
</head>
<body>
<center><table border=2 class="altrowstable" id="alternatecolor">
<tr>
<?php 
include 'session/session.php';
include 'database/connect.php';
$user = $_SESSION['logged'];
$query="SELECT b.email, b.pytanie, b.odpowiedz, a.imie, a.nazwisko, a.ulica, a.nr_domu, a.nr_mieszkania, a.miasto, a.kod_pocztowy, a.pesel, a.plec, a.data_ur, a.nr_telefonu FROM pacjent a JOIN user b ON a.id_user=b.ID WHERE b.login='".$user."'";
$result = mysql_query($query,$link);
$r = mysql_fetch_array($result);
echo "<h2>Twoje dane: </h2><br><br>";
echo "<tr><td><b>Email: </b></td>"."<td>".$r[0]."</td></tr>";
echo "<tr><td><b>Imię: </b></td>"."<td>".$r[3]."</td></tr>";
echo "<tr><td><b>Nazwisko: </b></td>"."<td>".$r[4]."</td></tr>";
echo "<tr><td><b>PESEL: </b></td>"."<td>".$r[10]."</td></tr>";
echo "<tr><td><b>Płeć: </b></td>"."<td>".$r[11]."</td></tr>";
echo "<tr><td><b>Data urodzenia: </b></td>"."<td>".$r[12]."</td></tr>";
echo "<tr><td><b>Ulica: </b></td>"."<td>".$r[5]."</td></tr>";
echo "<tr><td><b>Nr domu: </b></td>"."<td>".$r[6]."</td></tr>";
echo "<tr><td><b>Nr mieszkania: </b></td>"."<td>".$r[7]."</td></tr>";
echo "<tr><td><b>Kod pocztowy: </b></td>"."<td>".$r[9]."</td></tr>";
echo "<tr><td><b>Miasto: </b></td>"."<td>".$r[8]."</td></tr>";
echo "<tr><td><b>Telefon: </b></td>"."<td>".$r[13]."</td></tr>";
?>
</tr>
</table>

<br>
</center>
</body>
</html>
